<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="portal.entidades.Usuario"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../css/portal.css">
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="../scripts/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="../scripts/script.js"></script>
 <script src="../scripts/jquery.dataTables.min.js" type="text/javascript"></script>
 <script src="../scripts/jquery.jeditable.js" type="text/javascript"></script>
 <script src="../scripts/jquery-ui.js" type="text/javascript"></script>
 <script src="../scripts/jquery.validate.js" type="text/javascript"></script>
 <script src="../scripts/jquery.dataTables.editable.js" type="text/javascript"></script>
<title>Carrito 2014</title>

<script type="text/javascript">
	$(document).ready(function() {
		 //alert("1");
		 $('.last').click(function(){
			 //alert("2: " + $(this).attr('id'));
	     	cargarOpcion($(this).attr('id'));
	     });
	});

	function cargarOpcion(opcion){
		//alert(opcion);
		switch(opcion){
            case 'menu-comprar':
            	$.ajax({
              	    type: "POST",
              	    url: "../pages/home-comprar.jsp",
              	    success: function(a) {
              	       $('#div-results').html(a);
              	    }
                 });
            	break;
            	break;
            case 'menu-miscompras':
            	$.ajax({
              	    type: "POST",
              	    url: "../pages/home-mis-compras.jsp",
              	    success: function(a) {
              	       $('#div-results').html(a);
              	    }
                 });
                break;
            case 'menu-masvendidos':
            	$.ajax({
              	    type: "POST",
              	    url: "../pages/home-mas-vendidos.jsp",
              	    success: function(a) {
              	       $('#div-results').html(a);
              	    }
                 });
                break;
            case 'menu-configurar':
                //alert("menu-configurar");
               	$.ajax({
              	    type: "POST",
              	    url: "../pages/home-configurar-abmc.jsp",
              	  	cache: false,
               		async: false,
              	    success: function(a) {
               	       $('#div-results').html(a);
              	    }
                 });
            	break;
        }
    }
	
</script>
</head>
<body>
	<table width="100%" border="0" cellpadding="0"
		cellspacing="0">
		<tr>
			<td>
				<div id='cssmenu'>
					<ul>
						<li class='active has-sub'>
							<a href='#'><span>Compras Portal</span></a>
							<ul>
								<li class='last' id="menu-comprar"><a href='#'><span>Comprar</span></a></li>
								<li class='last' id="menu-miscompras"><a href='#' ><span>Mis Compras</span></a></li>
								<li class='last' id="menu-masvendidos"><a href='#'><span>M&aacute;s Vendidos</span></a></li>
							</ul>
						</li>
						<li class='last' id='menu-configurar'>
							<a href='#'><span>Configuraciones</span></a>
						</li>
						<li class='last'>
							<a href='../LogoutUsuario'><span>salir</span></a>
						</li>
					</ul>
				</div>
				<div
					style="width:350px; text-align: right; float: right; height: 42px; padding-left: 50px; vertical-align: middle; margin: 0px; background-color: #101010; border-left-color: #101010; border-left-color: red; border-top: 4px solid #3fa338; font-family: Calibri, Tahoma, Arial, sans-serif; position: absolute; top: 0; right: 0px;">
					<b>Id:</b>
					<b>
						<%
							if (session.getAttribute("usuario") != null) {
								Usuario usr = (Usuario) session.getAttribute("usuario");
								out.println((String) usr.getId().toString());
							}
						%>
					</b> <br> <b>Usuario: </b> 
					<b>
						<%
							if (session.getAttribute("usuario") != null) {
								Usuario usr = (Usuario) session.getAttribute("usuario");
								out.println((String) usr.getNombre() + " " + usr.getApellido());
							}
						%>
					</b>
				</div>
			</td>
		</tr>
		<tr>
		</table>
		<div id="div-results" style="align: center; height: 550px; background-color: #e6e6e6; color:black;">
		</div>
		<div style="width:'100%'; height: 40px; background-color: #101010;">
			<jsp:include page="../Layout/pie.jsp" flush="true" />
		</div>
</body>
</html>